package com.origin.opengles_ndk

import android.content.Context
import android.opengl.GLSurfaceView
import android.util.AttributeSet

class MyGLSurfaceView : GLSurfaceView {
    val myGLRender = MyGLRender();

    constructor(context: Context?) : this(context, null) {}
    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) {
        setEGLContextClientVersion(2)
        setRenderer(myGLRender)
    }

    public fun setParamsInt(i: Int) {
        myGLRender.setParamsInt(i)
        additional(i);
    }

    public fun unInit() {
        myGLRender.unInit()
    }

    private fun additional(i: Int) {
        if (i == 201) {
            myGLRender.loadRGBAImage(this.context, R.drawable.dzzz);
        }
    }
}